package com.sdsmusic.main;

import java.util.ArrayList;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import com.sdsmusic.Album.AlbumDAO;
import com.sdsmusic.Album.AlbumVO;
import com.sdsmusic.controller.Controller;

public class MainPageController implements Controller {

	@Override
	public String handleRequest(HttpServletRequest request) {
		HttpSession session = request.getSession();
		session.removeAttribute("album_list");
		String mem_id = (String) session.getAttribute("mem_id");
		if (mem_id != null) {
			ArrayList<AlbumVO> albumList = new AlbumDAO().getAlbumList();
			session.setAttribute("album_list", albumList);			
		}
		return "./main.jsp";
	}
}
